<?php
/**
 * Created by PhpStorm.
 * User: qch
 * Date: 2015/8/7
 * Time: 10:17
 */

namespace J\UI\Template\TagLib;



use J\UI\Engine\Thinkphp\TagLib;

class Test extends TagLib
{
    protected $tags = [
        'Test' => ['attr' => 'name'],
        'Print' => ['attr' => ''],
        'Bbs' => ['close' => false]
    ];

    public function _test($attributes, $content)
    {
        return '<' . $attributes['name'] . '>' . $content . '</' . $attributes['name'] . '>';
    }

    public function _bbs()
    {
        return '<br />' . "\n";
    }

    /**
     * @param $attributes
     * @param $content
     * @return string
     * @throws \Exception
     */
    public function _print(/** */$attributes, $content)
    {
        return '<p class="bg-info">' . highlight_string($this->tpl->content_compiler($content), true) . '</p>';
    }
}